package com.atguigu.feign;

import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

/**
 * 加了feign的订单支付客户端
 */

//如果pom依赖中包含mybatis数据库之类的包,而不在配置文件中引入数据源的各项配置,就会报错
//Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
//解决: 在主启动类添加忽略项(忽略数据库配置,忽略德鲁伊....等)
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,
        DataSourceTransactionManagerAutoConfiguration.class,
        DruidDataSourceAutoConfigure.class ,
        HibernateJpaAutoConfiguration.class})
@EnableEurekaClient
@EnableFeignClients//启用feign客户端
public class FeignTest {
    public static void main(String[] args) {
        SpringApplication.run(FeignTest.class,args);
    }
}
